﻿using Asplode;
using Asplode.GameEntity.Weapons;
using Microsoft.Xna.Framework;
using Asplode.GameEntity.Characters;

namespace FlyingGamePC.GameEntity.Weapons
{
    public class Mortar : Weapon
    {
        public Mortar()
            : base("mortar", 500, -1)
        {
        }

        public override void Shoot(GameObjectFactory gameObjectFactory, Character character)
        {
            Vector3 origin = character.gameObject.body.centerPosition + (Vector3.UnitY * 3);
            Vector3 shotAngle = character.rotationVector + Vector3.UnitY;
            shotAngle.Normalize();
            Vector3 velocity = shotAngle * 15;
            gameObjectFactory.AddGameObject(GameObject.Type.PROJECTILE, origin, velocity);

            FinishShot();
        }
    }
}
